#pragma once

#define EX_SAME_FUNCTIONS  1
#define EX_EMPTY 2
#define EX_WRONG_POINT 3

#define PI 3.1415926


class LinearFunction;

class LinearFunction
{
private:
  POINT           m_common;
  double          m_a;  //because the function has a syntax y=ax + b
  double          m_b;
  bool            m_c; //In case the function is constant like lim  -∞ -> y -> ∞ and constant x
  float           m_angle;
  LinearFunction* m_symetric;
public:
  LinearFunction(void);
  LinearFunction(const double, const double, const bool);
  ~LinearFunction(void);
  void Create(const POINT &,const POINT &);
  //void Create(const Vector2D &); //TODO: in feature
  const POINT & GetCommonPoint(const LinearFunction &); // Will return the common point
  const POINT & CalculateValue(const POINT &, const int); // if second parameter is 0 function will calculate y otherwise x
  const LinearFunction & GetSymetricFunction(const POINT &);
  void  GetSymetricFunction(LinearFunction &,const POINT &); //return function which are split segment symetricaly in given point
  const float Getangle(const LinearFunction &);
  const double GetA();
  const double GetB();
  const bool   GetC();
protected:
  bool TestPoint(const POINT &);
};
